using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IceSpawner : MonoBehaviour
{
    public GameObject mIceObj;
    // Start is called before the first frame update
    void Start()
    {
        for (int rowIndex = 0; rowIndex < GlobalDef.ROW_COUNT; ++rowIndex)
        {
            for (int columIndex = 0; columIndex < GlobalDef.COLUM_COUNT; columIndex++)
            {
                var obj = Instantiate(mIceObj);
                obj.SetActive(true);
                obj.transform.SetParent(transform,false);
                obj.transform.localPosition = new Vector3((columIndex - GlobalDef.COLUM_COUNT / 2f) * GlobalDef.CELL_SIZE + GlobalDef.CELL_SIZE / 2f,
                                                           (rowIndex - GlobalDef.ROW_COUNT / 2f) * GlobalDef.CELL_SIZE + GlobalDef.CELL_SIZE / 2f, 0);
            }
        }
    }

}
